package common.fengkai.filepost.JVM;

import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

/**
 * @author Fengkai
 * @creat 2021/12/15
 */
public class ClassLoadingFiled {

    //静态常量
    public  final static String staticString = "静态常量";

    //静态变量
    public  static String staticChangingString = "静态变量";

    //变量
    public String changingString = "变量";

    //静态代码块
    static {
        System.out.println("静态代码块");
        System.out.println("静态代码块:"+staticString);
        System.out.println("静态代码块:"+staticChangingString);

    }

    //代码块
    {
        System.out.println("代码块");
        System.out.println("代码块:"+staticString);
        System.out.println("代码块:"+staticChangingString);
        System.out.println("代码块:"+changingString);
    }

    //构造器
    public ClassLoadingFiled () {
        System.out.println("构造器");
        System.out.println("构造器:"+staticString);
        System.out.println("构造器:"+staticChangingString);
        System.out.println("构造器:"+changingString);
    }

       public static void main(String[] args) throws ClassNotFoundException {
                //创建类的实例
           ClassLoadingFiled classLoadingFiled = new ClassLoadingFiled();
           classLoadingFiled.changingString = "null";
           ClassLoader classLoader = Class.forName("classLoadingFiled").getClassLoader();
           System.out.println(classLoadingFiled);



       }
}
